- btn_class = (values.map { "#{value_prefix}#{_1}" } & checked_values).any? ? 'btn-secondary' : 'btn-outline-secondary'
%span.dropdown{ id: id }
  %button.btn.dropdown-toggle{ class: btn_class, data: { 'bs-toggle': :dropdown }, type: :button }
    %span.caret
    = text
  .dropdown-menu.keep-open.limit-height
    - if values.size > 5
      .dropdown-item-text
        = render partial: 'webui/shared/search_box', locals: { input_class: 'monitor-search', html_id: "search-#{id}", required: false }
    .text-center
      %button.btn.btn-link.monitor-filter-link{ type: :button } All
      %button.btn.btn-link.monitor-no-filter-link{ type: :button } None
    - values.each do |value|
      .dropdown-item
        .form-check
          = check_box_tag "#{value_prefix}#{value}", 1, checked = checked_values.include?("#{value_prefix}#{value}"), class: 'form-check-input'
          %label.form-check-label{ for: "#{value_prefix}#{value}" }
            = value
